

import java.io.File;
import java.util.Date;

import com.sun.jmx.snmp.Timestamp;
import com.xiaoleilu.hutool.date.DateUtil;
import com.xiaoleilu.hutool.http.HttpUtil;

public class TEST {

	public static void main(String[] args) throws Exception {
		Timestamp t = new Timestamp(1288834974657L);
		String s = DateUtil.format(t.getDate(), "yyyy-MM-dd HH:mm:ss");
		System.err.println(s);
		//getDondow("https://video-hw.xvideos-cdn.com/videos/mp4/f/7/2/xvideos.com_f720aae3c3b5dbb429f4f7cdf4cc62d4.mp4?e=1518882069&ri=1024&rs=85&h=048bb70ea5912a9952ab3be471aa3724", "H:\\FileTemp\\"+DateUtil.format(new Date(), "yyyyMMddHHmmss")+".mp4");
	}

	// 下载视频方法
	private static void getDondow(String url, String pathName) throws Exception {
		File destFile = new File(pathName);
		HttpUtil.downloadFile(url, destFile);
		//URLConnection connection = HttpUtil.get(url);
		 // 建立实际的连接  
//        connection.connect();  
//        connection.getInputStream();
//		BufferedInputStream bi = new BufferedInputStream(connection.getInputStream());
//		System.err.println("视屏的时长：" + connection.getContentLength());
//		FileOutputStream bs = new FileOutputStream(pathName);
//		byte[] by = new byte[1024];
//		int len = 0;
//		while ((len = bi.read(by)) != -1) {
//			bs.write(by, 0, len);
//		}
//		bs.close();
//		bi.close();
	}
}